import pytest
import requests
from 接口自动化.send.Send import Send
from 接口自动化.utils.read_yaml import read_yaml
class TestRegister:

    @pytest.mark.parametrize( "args" ,  read_yaml("../data/register.yaml")  )
    def test_register(self,args):

        name = args["username"]
        pwd= args["pwd"]
        exp = args["exp"]

        session  = requests.session()

        se = Send()
        result = se.send_register(session,name,pwd)

        assert result["code"] == 200 and result["body"]["code"] == exp
